Colin Walters [Thu, 3 Oct 2013 22:32:41 +0000 (18:32 -0400)]
sysroot: Move ostree_sysroot_origin_new_from_refspec here
Rather than having it live in admin. This is useful for other
consumers like the test suite.
Colin Walters [Thu, 3 Oct 2013 22:31:07 +0000 (18:31 -0400)]
sysroot: Ensure we create /boot/loader.%d/entries even if there are no deployments
Not doing so breaks things, and we should support this.
Colin Walters [Thu, 3 Oct 2013 22:30:07 +0000 (18:30 -0400)]
sysroot: Avoid bad double-free
If a deployment is somehow in the list twice, the hash table will free
the *new* value with g_hash_table_insert which gets all broken. Just
use g_hash_table_replace().
Colin Walters [Thu, 3 Oct 2013 22:29:40 +0000 (18:29 -0400)]
sysroot: Update some annotations
We were double-freeing before.
Colin Walters [Tue, 17 Sep 2013 02:37:00 +0000 (22:37 -0400)]
sysroot: Support more arbitrary deployment changes
This commit changes the sysroot API so that one can create arbitrary
new deployment checkouts, then commit them as one step. This is to
enable things like an automatic bisection tool which say create 50
deployments at once, then when done clean them up.
This also moves some printfs from the library into src/ostree.
Colin Walters [Wed, 2 Oct 2013 23:47:38 +0000 (19:47 -0400)]
tests: Add a simple test-sysroot.js that covers OSTree.Sysroot
This will be more interesting as a test case user of the API.
Colin Walters [Wed, 2 Oct 2013 13:00:10 +0000 (09:00 -0400)]
repo: Only delete temp files older than a day
This is somewhat lame, but to do better we need a reliable
multiprocess synchronization mechanism.
https://bugzilla.gnome.org/show_bug.cgi?id=709115
Colin Walters [Mon, 30 Sep 2013 12:51:25 +0000 (08:51 -0400)]
repo: Enumerate objects using openat() too, make more efficient
This drops several calls to malloc()/g_object_new() per object
enumeration. Just a followup to using openat() and friends in other
places.
Colin Walters [Mon, 30 Sep 2013 00:17:18 +0000 (20:17 -0400)]
core: Make ostree_get_relative_object_path() private
I plan to rename all of these APIs to use the term 'loose', so that it
makes more sense after pack files are introduced. External users
should not use them; instead use _load_variant() or _read_commit().
Jeremy Whiting [Thu, 5 Sep 2013 18:50:36 +0000 (12:50 -0600)]
pull: Verify commits with gpg signatures from detached metadata
This uses gpgv for verification against DATADIR/ostree/pubring.gpg by
default. The keyring can be overridden by specifying OSTREE_GPG_HOME.
Add a unit test for commit signing with gpg key and verifying on pull;
to implement this we ship a test GPG key generated with no password
for Ostree Tester <test@test.com>.
Change all of the existing tests to disable GPG verification.
Colin Walters [Sun, 29 Sep 2013 18:00:53 +0000 (14:00 -0400)]
commit: Store detached metadata in normal form
Otherwise corrupted variants may crash us.
Jeremy Whiting [Tue, 3 Sep 2013 01:43:49 +0000 (19:43 -0600)]
core: Use libgpgme to add GPG signatures to detached metadata for commit object
Add an optional dependency on gpgme to add GPG signatures into the
detached metadata, with the key "ostree.gpgsigs", as an "aay", an
array of signatures (treated as binary data).
The commit command gains a --gpg-sign=<key-id> argument. Also add an
argument --gpg-homedir to set the GPG homedir where we look for
keyrings.
Colin Walters [Sat, 28 Sep 2013 16:00:16 +0000 (12:00 -0400)]
remote-add: Add --set=KEY=VALUE option
This can be used to add a remote and set e.g. tls-permissive=true, or
gpgverify=false.
Colin Walters [Fri, 27 Sep 2013 16:55:07 +0000 (12:55 -0400)]
show: Handle keys of any type, and set an error if key doesn't exist
Previously we were just handling strings, and silently doing nothing
if the key didn't exist, which is pretty broken.
Colin Walters [Thu, 26 Sep 2013 18:38:37 +0000 (14:38 -0400)]
repo-pull: Allocate with g_new0 rather than g_new.
Conflicts:
src/libostree/ostree-repo-pull.c
Colin Walters [Thu, 26 Sep 2013 18:00:36 +0000 (14:00 -0400)]
pull: Also fetch detached commitmeta files
These will contain GPG signatures and the like in the future, so we
should fetch them now.
Colin Walters [Thu, 26 Sep 2013 17:59:08 +0000 (13:59 -0400)]
repo: When adding detached metadata, ensure the objdir exists
We may be creating the commitmeta file before the commit, so we need
to call mkdir(<first two checksum characters>) here too.
Colin Walters [Thu, 26 Sep 2013 17:57:59 +0000 (13:57 -0400)]
show: Print an error message if commit doesn't have detached metadata
...instead of segfaulting.
Colin Walters [Tue, 24 Sep 2013 18:10:40 +0000 (14:10 -0400)]
fetcher: Fix previous commit
I was getting hangs in the test suite, and looking at the previous
commit, we were calling the async completion functions out of the
finalizer for the URI, which is weird. I didn't analyze what's going
wrong, but what we really should be doing is processing our internal
queue after we've downloaded a file, and the request is about to be
finalized.
I suspect doing queue management from the finalizer created a circular
reference type situation.
This patch deduplicates the queue processing bits too.
https://bugzilla.gnome.org/show_bug.cgi?id=708126
Sjoerd Simons [Sun, 15 Sep 2013 19:25:02 +0000 (21:25 +0200)]
fetcher: Add a queue to limit requests sent to soup
On a large ostree repository pulling over http slows to a crawl. Pulling
from localhost results in:
5944 metadata, 63734 content objects fetched; 850509 KiB transferred in
1106 seconds
In other words about 800KiB/s. Some profiling shows that essentially
all of the CPU goes into libsoup doing its request bookkeeping instead
of into the actual downloading.
Adding a simple queue to limit to number of active request sent into
libsoup makes for a dramatic improvement:
5944 metadata, 63734 content objects fetched; 850509 KiB transferred
in 89 seconds
So around 9450 KiB/s.
https://bugzilla.gnome.org/show_bug.cgi?id=708126
Colin Walters [Sat, 21 Sep 2013 15:06:20 +0000 (11:06 -0400)]
tests: Add u-boot
It needs to be installed so it'll be run by the InstalledTests scheme.
Javier Martinez Canillas [Sat, 21 Sep 2013 01:35:55 +0000 (03:35 +0200)]
tests: Fix U-Boot test case
commit
08b873457 ("deploy: Remove checksum from generated loader entries")
changed the generated loader entries file names thus making the U-Boot test
case to fail since this test parsed those files.
Fix test-admin-deploy-uboot.sh by looking to the updated files names.
https://bugzilla.gnome.org/show_bug.cgi?id=708511
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Colin Walters [Fri, 20 Sep 2013 18:00:31 +0000 (14:00 -0400)]
libostree: Document and annotate some methods to quash g-ir-scanner warnings
Since warnings are bad. Introspection is good.
Colin Walters [Fri, 20 Sep 2013 17:54:43 +0000 (13:54 -0400)]
libostree: Remove private header file from ostree.h
Was breaking pkgsys-ostree.
Colin Walters [Fri, 20 Sep 2013 13:42:50 +0000 (09:42 -0400)]
upgrade: Don't segfault if there's no previous deployment
Obviously.
Colin Walters [Fri, 20 Sep 2013 12:09:06 +0000 (08:09 -0400)]
deploy: Correctly swap bootloader version with new boot checksums
If we had two deployments with different boot checksums, and were
trying to remove the one that was the same and add a new one (the
normal case), we'd end up assuming due to comparison with 0 that
we only needed to do the fast subbootversion swap.
Fix this by actually putting 1 where we really mean 1.
And update the tests to verify the fix; I have double-verified by
undoing the fix, and noting that the test fails.
https://bugzilla.gnome.org/show_bug.cgi?id=708351
Colin Walters [Fri, 20 Sep 2013 02:41:33 +0000 (22:41 -0400)]
deploy: Remove checksum from generated loader entries
The actual deployment checksum shouldn't be in there, because we may
just swap bootlinks, rendering the name of the old bootloader entry
file invalid. Thankfully nothing actually parsed the names of these
files, so let's just use the index.
Colin Walters [Fri, 20 Sep 2013 02:26:03 +0000 (22:26 -0400)]
deploy: Do a full system sync after writing bootloader config
This is just something I noticed on inspection; we should catch any
changes to /boot in the sync(), even though theoretically gio should
have done fdatasync().
Colin Walters [Fri, 20 Sep 2013 02:25:12 +0000 (22:25 -0400)]
deploy: Only query bootloader if we have to make a loader change
This will also help distinguish in the output when we're just swapping
bootlinks versus when we need to change the loader config.
Colin Walters [Fri, 20 Sep 2013 02:09:48 +0000 (22:09 -0400)]
deploy: Some minor assertion and error message improvements
To help debug https://bugzilla.gnome.org/show_bug.cgi?id=708351
Plus run a status consistently in the tests.
Colin Walters [Wed, 18 Sep 2013 22:44:57 +0000 (18:44 -0400)]
libostree: Add API to write metadata as stream
And use it in pull-local. The goal here is to kill users of
ostree_repo_load_variant(), and move a bit more towards hiding the
variants.
Colin Walters [Wed, 18 Sep 2013 20:34:57 +0000 (16:34 -0400)]
test-core.js: Add standard copyright header
Like everything else.
Colin Walters [Wed, 18 Sep 2013 20:34:14 +0000 (16:34 -0400)]
main: Print error: in red bold just for fun
It's easier to see. Also drop old dead ot_main() function.
Colin Walters [Wed, 18 Sep 2013 16:01:46 +0000 (12:01 -0400)]
tests: Add a gjs-based test
This covers introspection, and in general is a much better way to get
API coverage tests.
Colin Walters [Tue, 17 Sep 2013 14:53:41 +0000 (10:53 -0400)]
sysroot: Look for booted deployment correctly
We need to look at the list we just gathered, not potentially NULL.
Colin Walters [Mon, 16 Sep 2013 13:13:58 +0000 (09:13 -0400)]
sysroot: Clean up API
Now that we have a real GObject for the sysroot, we have a convenient
place to keep track of 4 pieces of state:
* The current deployment list
* The current bootversion
* The current subbootversion
* The current booted deployment (if any)
Avoid requiring callers to pass all of this around and load it
piecemeal; instead the new thing is ostree_sysroot_load().
Colin Walters [Mon, 16 Sep 2013 12:52:16 +0000 (08:52 -0400)]
libostree: Use ostree_repo_create() rather than spawning subprocess
We have API now, yay!
Colin Walters [Mon, 16 Sep 2013 02:44:25 +0000 (22:44 -0400)]
doc: Add some more OstreeSysroot docs
Colin Walters [Mon, 16 Sep 2013 00:26:13 +0000 (20:26 -0400)]
libostree: Make OstreeBootloader private
It was only temporarily public while functionality was being merged
down; that's done now.
Colin Walters [Mon, 16 Sep 2013 00:21:49 +0000 (20:21 -0400)]
admin: Drop two uses of ostree_sysroot_get_path()
Moving towards it being a full library.
Colin Walters [Mon, 16 Sep 2013 00:16:20 +0000 (20:16 -0400)]
libostree: Nearly complete move of API into OstreeSysroot
Move the deployment code too.
Colin Walters [Sun, 15 Sep 2013 22:07:34 +0000 (18:07 -0400)]
libostree: Move a lot more sysroot API here
OstreeBootloader is temporarily public API.
Colin Walters [Sun, 15 Sep 2013 19:16:56 +0000 (15:16 -0400)]
libostree: Move sysroot initialization API here
Colin Walters [Sun, 15 Sep 2013 19:06:31 +0000 (15:06 -0400)]
Move Deployment and BootconfigParser into libostree
As part of moving admin functionality there. While we are doing this,
rename OtConfigParser to OstreeBootConfig parser since it's a better
name.
Colin Walters [Sun, 15 Sep 2013 18:33:57 +0000 (14:33 -0400)]
libostree: Add new OstreeSysroot class
At the moment, just a container for a path, but we will start moving
admin functionality here.
Javier Martinez Canillas [Sun, 1 Sep 2013 14:05:16 +0000 (16:05 +0200)]
admin: add U-Boot backend test case
OSTree now supports a backend for the U-Boot bootloader,
add a test case for this.
https://bugzilla.gnome.org/show_bug.cgi?id=708069
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Javier Martinez Canillas [Sun, 1 Sep 2013 11:07:17 +0000 (13:07 +0200)]
tests: allow setup_os_repository to create U-Boot stub config
Currently OSTree supports two bootloader backends: syslinux
and U-Boot; allow to create a stub configuration for both.
https://bugzilla.gnome.org/show_bug.cgi?id=708069
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Javier Martinez Canillas [Sat, 31 Aug 2013 21:04:48 +0000 (23:04 +0200)]
tests: don't create a syslinux stub unconditionally in libtest
libtest.sh has an setup_os_repository() helper function tha is
used by many tests to setup an OSTree initial repository.
This function creates an syslinux configuration unconditionally
but OSTree supports other bootloader backends besides syslinux.
So, is better to conditionally create a syslinux configuration
only when it is needed.
https://bugzilla.gnome.org/show_bug.cgi?id=708069
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Colin Walters [Fri, 13 Sep 2013 21:14:35 +0000 (17:14 -0400)]
checkout: Fix leak when doing uncompressed cache + copying checkouts
We were reading into "input" twice, leading a fd. This was
breaking the gnome-continuous integrationtest.
Colin Walters [Fri, 13 Sep 2013 20:45:43 +0000 (16:45 -0400)]
pull: Drop usage of 2.36 symbol
Really need deprecation warnings while using RHEL6.4...maybe Software
Collections will save me.
Colin Walters [Fri, 13 Sep 2013 20:43:27 +0000 (16:43 -0400)]
Update libgsystem
With tempfile fix.
Colin Walters [Fri, 13 Sep 2013 03:53:13 +0000 (23:53 -0400)]
doc: Add OstreeMutableTree, other minor doc updates
Colin Walters [Thu, 12 Sep 2013 18:34:38 +0000 (14:34 -0400)]
admin: Silence a gcc warning
It can't happen, but anyways.
Colin Walters [Wed, 11 Sep 2013 23:55:24 +0000 (19:55 -0400)]
COPYING: Now fully LGPLv2+
I ran into Jeremy Katz today, and he gave me permission to relicense
the small bits of switch-root.c to LGPLv2+. This combined with
permission from Peter Jones allows OSTree to become fully LGPLv2+.
Not a big deal, it's just a lot clearer to only have one license, and
it makes it easier to turn application code into library code.
Colin Walters [Wed, 11 Sep 2013 15:54:53 +0000 (11:54 -0400)]
checkout: Fix previous commit
Don't try to close in cases where we don't have input.
Colin Walters [Wed, 11 Sep 2013 14:58:22 +0000 (10:58 -0400)]
checkout: Fix file descriptor leak for copying checkouts
Hardlink checkouts didn't hit this, but we need to close the input
stream.
Colin Walters [Wed, 11 Sep 2013 12:28:09 +0000 (08:28 -0400)]
Update libgsystem
And while we're here, also update the TODO slightly.
Colin Walters [Tue, 10 Sep 2013 16:25:13 +0000 (12:25 -0400)]
libostree: Fix compiler warning
Colin Walters [Tue, 10 Sep 2013 15:53:40 +0000 (11:53 -0400)]
checkout: Add g_prefix_error() around more failures
So we can debug what's going wrong more easily.
Jasper St. Pierre [Sun, 8 Sep 2013 16:43:21 +0000 (12:43 -0400)]
repo: Make the optimization for reusing checksums clearer
The code here is a bit hard to understand, so make it clearer by cleaning
up the flow control and adding some comments.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 18:21:24 +0000 (14:21 -0400)]
repo: Make read_commit spit out a resolved commit ref as well
read_commit resolves the ref to a commit, and a lot of consumers want
the resolved commit for their own purposes; this prevents them from
calling resolve_rev themselves.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 04:42:25 +0000 (00:42 -0400)]
repo-libarchive: Apply commit modifiers to libarchive archives as well
And document the libarchive methods as well, so we can pass a NULL
commit modifier.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 00:17:44 +0000 (20:17 -0400)]
repo: Change the pairs of checksums to instead be based on OstreeRepoFiles
We want an OstreeRepoFile to be the way to reference a "filesystem
tree" that's stored in the repo, which is a combination of a DIR_TREE
and a DIR_META. The idea is that once you write an mtree to the repo
using ostree_repo_write_mtree, it becomes serialized and you get an
OstreeRepoFile in return.
Change any APIs that care about DIR_TREE / DIR_META checksums to care
about OstreeRepoFiles instead, which right now is mostly is
ostree_repo_write_commit.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 03:27:45 +0000 (23:27 -0400)]
repo-file: Base OstreeRepoFile on trees instead of commits
We want an OstreeRepoFile to be the way to represent a filesystem tree
inside an ostree repository. In order to do this, we need to drop the
commit from an OstreeRepoFile, and make that go to callers.
Switch all current users of ostree_repo_file_new_root to
ostree_repo_read_commit, and make the actual constructor private.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Colin Walters [Mon, 9 Sep 2013 21:01:32 +0000 (17:01 -0400)]
core: Add detached metadata, readd metadata to commits
Previously I thought we'd have to ditch the current commit
format to avoid a{sv} due to
See https://bugzilla.gnome.org/show_bug.cgi?id=673012
But I realized that we don't really have to care about
unpacking/repacking commit objects, so let's just re-expose the
existing metadata a{sv} in commits in the API.
Also, add support for "detached" metadata that can be updated at any
time post-commit. This is specifically designed for GPG signatures.
https://bugzilla.gnome.org/show_bug.cgi?id=707379
Colin Walters [Mon, 9 Sep 2013 20:06:51 +0000 (16:06 -0400)]
Update libgsystem
Now with new shiny implementation of gs_shutil_rm_rf().
Vivek Dasmohapatra [Mon, 9 Sep 2013 14:54:26 +0000 (15:54 +0100)]
pull: ref the thread default main context during init, unref in cleanup
...get_thread_default returns NULL when the thread default is also the global
default, so this only shows up when running in a thread (eg g_task_run_in_thread)
Colin Walters [Sun, 8 Sep 2013 23:31:44 +0000 (19:31 -0400)]
core: Use openat() for reading bare file objects too
...unless we want xattrs, in which case we have to fallback to path
lookup due to lack of llistxattrat().
This looks nicer in strace.
Colin Walters [Sun, 8 Sep 2013 20:49:21 +0000 (16:49 -0400)]
core: Delete unused OstreeRepoFile API
Was just unused, and it was using further API i want to remove.
Colin Walters [Sun, 8 Sep 2013 19:04:35 +0000 (15:04 -0400)]
repo: Delete leftover repo/pending dir
This is a relic from long ago when we were trying to stage objects
before finally committing them all in one go in the pull code.
We're no longer doing that, so stop trying to make the directory.
This also fixes trying to use ostree as non-root to read the
root-owned repo, since we'd fail to create the pending dir.
Colin Walters [Sun, 8 Sep 2013 14:35:47 +0000 (10:35 -0400)]
core: Use at-relative functions for checking out tree copies too
For the cases where we can't hardlink, use at-relative walking of the
path where possible. We still don't have lsetxattrat, so we also need
to deal with pathnames, but that is now only for symlinks.
Again, the advantages of this are a lot less malloc() of pathnames in
ostree, and much less time spent traversing paths inside the kernel.
https://bugzilla.gnome.org/show_bug.cgi?id=707733
Colin Walters [Sun, 8 Sep 2013 01:56:36 +0000 (21:56 -0400)]
core: Make ostree_set_xattrs() private
Nothing external uses it. We keep ostree_get_xattrs_for_file() public
because it's convenient for external consumers to get xattrs in
exactly the format we desire.
https://bugzilla.gnome.org/show_bug.cgi?id=707733
Colin Walters [Sun, 8 Sep 2013 01:49:56 +0000 (21:49 -0400)]
core: Make write_object() a bit more efficient
Do as many operations as we can using the original file descriptor
while we have it open, rather than writing, closing, then reopening.
This necessitated very explicitly special casing symbolic links,
mainly due to the lack of lsetxattrat().
https://bugzilla.gnome.org/show_bug.cgi?id=707733
Colin Walters [Sat, 7 Sep 2013 23:01:27 +0000 (19:01 -0400)]
core: Use linkat() for hardlink checkouts too
Clean up how we deal with the uncompressed object cache; we now use
openat()/linkat() and such just like we do for the main objects/.
Use linkat() between the objects and the destination, if possible.
https://bugzilla.gnome.org/show_bug.cgi?id=707733
Jasper St. Pierre [Sat, 7 Sep 2013 00:09:59 +0000 (20:09 -0400)]
repo: Make the body parameter to ostree_repo_commit optional
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 00:09:44 +0000 (20:09 -0400)]
repo: Drop the branch parameter from ostree_repo_commit
It's unused. Make users explicitly write a ref if they want this;
high-level convenience API will be introduced later.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Fri, 6 Sep 2013 23:35:23 +0000 (19:35 -0400)]
builtin-commit: Don't parse the parent's GVariant by hand
Instead, use OstreeRepoFile as a handle for the parent commit.
We need to add an accessor for the metadata checksum, as that
hasn't been exposed before.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Jasper St. Pierre [Sat, 7 Sep 2013 00:19:42 +0000 (20:19 -0400)]
repo-file: s/content_checksum/contents_checksum/
This is what we call it everywhere else, so just be consistent.
It also lines up with metadata_checksum better.
https://bugzilla.gnome.org/show_bug.cgi?id=707727
Colin Walters [Sun, 8 Sep 2013 14:41:18 +0000 (10:41 -0400)]
repo: Fix file descriptor leak from previous commit
I keep forgetting mmap doesn't take ownership of the fd.
Colin Walters [Sat, 7 Sep 2013 14:10:21 +0000 (10:10 -0400)]
core: Use at-relative lookups for archive-z2 content
We can't quite do it for bare repositories yet because we need to have
a way to go from struct stat -> GFileInfo, and that's buried in gio's
private GLocalFile class.
Colin Walters [Sat, 7 Sep 2013 09:01:41 +0000 (05:01 -0400)]
core: Use at-relative lookups for metadata reading
Just use openat() for locating variants, rather than doing the lstat()
+ open(). This also drops several malloc+object allocations from the
lookup path.
Colin Walters [Sat, 7 Sep 2013 08:47:40 +0000 (04:47 -0400)]
core: Use at-relative lookup for locating objects too
Add new internal API to both fstatat() and write a pathname for the
given object. Use it in commit, and also wrapped in the old
GFile-based API.
This is more efficient.
Colin Walters [Sat, 7 Sep 2013 00:33:55 +0000 (20:33 -0400)]
core: Add malloc-free API for objects, use *at functions for storing
This is more efficient; we avoid malloc of a number of pathname +
GFile objects, plus the kernel doesn't have to traverse the repo path
again.
Jasper St. Pierre [Sat, 7 Sep 2013 05:37:09 +0000 (01:37 -0400)]
repo: Make commit_transaction introspectable
Jasper St. Pierre [Sat, 7 Sep 2013 00:47:13 +0000 (20:47 -0400)]
Fix build
Before I pushed the "move code to a different file" commit, I rebased,
but forgot to test the build. Sorry.
Jasper St. Pierre [Thu, 5 Sep 2013 21:25:26 +0000 (17:25 -0400)]
Move ref writing to be transaction-based
Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Fri, 6 Sep 2013 22:51:54 +0000 (18:51 -0400)]
repo: Move the scanning hardlinks optimization out of prepare_transaction
This is just a terrible API to have. Make the scanning a separate method,
and document it as an optimization.
Jasper St. Pierre [Thu, 5 Sep 2013 21:57:53 +0000 (17:57 -0400)]
repo: Make abort_transaction silently succeed if we're not in a transaction
This helps callers out a lot, and means we can always call abort_transaction
at the end of a function.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 20:48:40 +0000 (16:48 -0400)]
repo: Move the transaction stats to a separate struct
This is much easier for callers to handle, and simplifies
the API a lot.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 20:36:44 +0000 (16:36 -0400)]
repo: Rename "stage" to "write" in the API
An earlier version of this API acted like git in that some objects
would be staged in a temporary directory which would be then committed
in one go by moving files around. The API doesn't match most users
expectations though, as while the stage is nice as a high-level API
it isn't really suited for low-level APIs.
While the stage was removed, the APIs were never renamed. Rename
them now so that they match expectations.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 19:43:07 +0000 (15:43 -0400)]
repo: Move commit code to another file
ostree-repo.c is a bit too big, and most of the commit code is
fairly standalone.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 19:30:25 +0000 (15:30 -0400)]
repo: Make prepare_transaction introspectable
We need to document the out pointer as an out pointer.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 19:10:54 +0000 (15:10 -0400)]
repo: Make OSTreeCommitModifier introspectable
Callbacks need GDestroyNotifies to be usable from bindings.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Jasper St. Pierre [Thu, 5 Sep 2013 19:30:15 +0000 (15:30 -0400)]
repo: Make the ordering consistent between abort/complete_transaction
This just makes the functions nicer to stare at.
https://bugzilla.gnome.org/show_bug.cgi?id=707644
Colin Walters [Fri, 6 Sep 2013 22:28:20 +0000 (18:28 -0400)]
core: When using hardlinks, always use linkat() for destination
This avoids repeatedly traversing the target pathname, and is just
more efficient.
Part of a prelude to using fd-relative API for the source object path
too.
Colin Walters [Fri, 6 Sep 2013 22:19:54 +0000 (18:19 -0400)]
core: Use fd-relative creation for tmp/
Update libgsystem submodule for a bugfix.
This is both more efficient from a kernel perspective, and avoids us
calling gs_file_get_path_cached() on tmp_dir constantly, which
triggered another bug due to lack of locking.
Jasper St. Pierre [Thu, 5 Sep 2013 22:18:51 +0000 (18:18 -0400)]
Update .gitignore
Jasper St. Pierre [Thu, 5 Sep 2013 20:38:06 +0000 (16:38 -0400)]
Update docs
Jasper St. Pierre [Thu, 5 Sep 2013 17:41:46 +0000 (13:41 -0400)]
repo: Rename ostree_repo_check to ostree_repo_open
As it more clearly describes what the function does: load the
repo from disk and initialize it.
At the same time, add a cancellable parameter.
https://bugzilla.gnome.org/show_bug.cgi?id=707582
Jasper St. Pierre [Thu, 5 Sep 2013 04:14:30 +0000 (00:14 -0400)]
repo: Move the 'init' builtin command to a public API, ostree_repo_create
This continues the goal of making more of ostree accessible by API,
rather than forking out to subprocesses.
https://bugzilla.gnome.org/show_bug.cgi?id=707582